package com.kun.kunkunmall.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kun.common.to.OrderTo;
import com.kun.common.to.StockLockedTo;
import com.kun.common.utils.PageUtils;
import com.kun.kunkunmall.ware.entity.WareSkuEntity;
import com.kun.common.to.SkuHasStockVo;
import com.kun.kunkunmall.ware.vo.LockStockResult;
import com.kun.kunkunmall.ware.vo.WareSkuLockVo;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author wsk
 * @email wsk@gmail.com
 * @date 2023-04-22 13:52:20
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuHasStockVo> getSkusHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo vo);

    void unlockWareStock(StockLockedTo stockLockedTo, Message message, Channel channel);

    void unlockWareStock(OrderTo to);
}

